package com.zhixue.content.controller;

import com.zhixue.content.model.dto.CoursePreviewDto;
import com.zhixue.content.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther: 李 力
 * @Date: 2025/5/3
 * @Description: com.zhixue.content.controller
 * @version: 1.0
 */
@RestController
@RequestMapping("/open")
public class CourseOpenController {
    @Autowired
    private CourseBaseService courseBaseService;

    @Autowired
    private CoursePublishService coursePublishService;

    //根据课程ID查询课程信息
    @GetMapping("/course/whole/{courseId}")
    public CoursePreviewDto getPreviewInfo(@PathVariable("courseId") Long courseId) {
        //获取课程预览信息
        CoursePreviewDto coursePreviewInfo = coursePublishService.getCoursePreviewInfo(courseId);
        return coursePreviewInfo;
    }
}
